版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/23/2013-11-23-CODE 132 Candy/
访问原文「CODE 132. Candy」
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
- Each child must have at least one candy.
- Children with a higher rating get more candies than their neighbors.
What is the minimum candies you must give?
|
|